import os 
def make_at(path, dir_name): 
    original_path = os.getcwd() 
    os.chdir(path) 
    os.mkdir(dir_name) 
    os.chdir(original_path)

#Save the current location, we will need it later
home = os.getcwd()
make_at('C:\\','New Folder')
os.getcwd()
#Unexpected Side effects when the code fails
#Run the code a second time and notice what happens!
#Set the directory back to home
os.chdir(home) 

#Use finally clause to set our directory back when finished
def make_at(path, dir_name): 
    original_path = os.getcwd() 
    try:
        os.chdir(path) 
        os.mkdir(dir_name)
    except OSError as e:
        print(e,  file=sys.stderr)
        raise 
    finally:
        os.chdir(original_path)

os.getcwd()
make_at('C:\\','New Folder')
os.getcwd()